Expanding the page footer on a report's last page

I have a report where I sometimes need to put in a variable size text in the footer of the last page.
There was already some working code in the OnBeforePrint callback to show some more objects on the last page:
  if <Page> = <TotalPages> then
  begin              
    ...
  end;

I tried to put in the resizing in this block but nothing happened, probably becasue it is too late to resize the page footer at that stage.

Instead I put the code in OnBeforePrint callback of the page header. At first I forgot to add the "if <Page> = <TotalPages>" condirtion and then it worked if I had a one page report.
After adding the last page condition it stopped working again. My guess is that TotalPages cannot yet be calculated at that point.

Anyone got a solution to this dilemma?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 8:38AM
    the pagefooter is not resizeable.
  • edited 8:38AM
    gordk wrote: »
    the pagefooter is not resizeable.
    Well, it works anyway. I calculate the extra height needed and then I adjust both the height and top prperties nd I get a larger page footer.
    Or does it only work before any rendering is done?
    If the page footer is not resizeable after the first page is rendered I need to find some other solution. Making the page footer large enough to suffice for the last page would mean a lot of wasted space on all the other pages.
  • gordkgordk St.Catherines On. Canada.
    edited 8:38AM
    you can alter the top and height, you cannot stretch the the page footer.
    first make the report 2 pass, so you have totalpages available,
    write code in the oap event of the page header to test if you are on the final pass
    and the amount of freespace left then if enough space then you can alter the top and height of the page footer and it's objects
    be careful as you can widow objects to the page when you go back to origianl size.
    you need to reset the page footer in its oap event after printing, or when starting the report or your size will be wrong for the other pages.
  • edited 8:38AM
    Thanks, will try that out.
    What to do if there isn't enough free space to fit the larger pagefooter? Is there a way to add one more page?
  • gordkgordk St.Catherines On. Canada.
    edited 8:38AM
    engine.newpage will do it.
  • edited 8:38AM
    The OAP code doesn't sem to be able to change height/top of the page footer. The code is run (The 'Hej hopp' string is displayed), but it seems the lines concerning the pagefooter properties won't take effect. Any ideas? We are still running on Fast Report 4.12, would it work differently on 4.15?
    procedure PageHeader1OnAfterPrint(Sender: TfrxComponent);
    var      
      finstiltOffset : Extended;                                                          
    begin
           if Engine.FinalPass and (<Page> = <TotalPages>) and (<AnvandFinstilt> = True) then
           begin
                  PlusgiroRubrik.Memo.Text := 'Hej hopp';                                                                                                                                                                                                                
                  FinstiltOffset := Finstilt.Height + 5*EnMilimeter.Height;                                                                                                                                                                                                                                                                                                                          
                  Finstilt.Visible := True;
                  Finstilt.Top := SlutRader.Top + SlutRader.Height + 1.5*EnMilimeter.Height;                                                                                                                                                                   
                  PageFooter1.Height := PageFooter1.Height + FinstiltOffset;
                  PageFooter1.Top := PageFooter1.Top - FinstiltOffset;
                  BeloppAttBetala.Top := BeloppAttBetala.Top + FinstiltOffset;
                  KvitterasR.Top := KvitterasR.Top + FinstiltOffset;                                                                    
           end;  
    end;
    
  • gordkgordk St.Catherines On. Canada.
    edited 8:38AM
    My own personal opinion and experience is to NOT USE a page footer in this way
    it should be used to contain things like page#, totlapages, date printed etc..
    it is better to use either a footer, groupfooter, column footer, or child band (can be unattached),
    as these can be adjusted well beforee the end of the output(visibility,and position).
  • edited 8:38AM
    OK. I believe you are right! > Thanks for your time!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.